<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link type="text/css" rel="stylesheet" href="css/style.css" />
		<!--[if IE 6]>
    <script src="js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->
		<script type="text/javascript" src="js/jquery-1.11.1.min_044d0927.js"></script>
		<script type="text/javascript" src="js/jquery.bxslider_e88acd1b.js"></script>

		<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
		<script type="text/javascript" src="js/menu.js"></script>

		<script type="text/javascript" src="js/select.js"></script>

		<script type="text/javascript" src="js/lrscroll.js"></script>

		<script type="text/javascript" src="js/iban.js"></script>
		<script type="text/javascript" src="js/fban.js"></script>
		<script type="text/javascript" src="js/f_ban.js"></script>
		<script type="text/javascript" src="js/mban.js"></script>
		<script type="text/javascript" src="js/bban.js"></script>
		<script type="text/javascript" src="js/hban.js"></script>
		<script type="text/javascript" src="js/tban.js"></script>

		<script type="text/javascript" src="js/lrscroll_1.js"></script>
		<script src="js/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function() {
				
				
				
				
			  /* $(".log_btn").css("background-image","none"); */
				
				//用户名正则判断
				$(".l_user").blur(function() {
					var userName = $(".l_user").val();
					var ret = /^[a-zA-Z0-9_-]{4,16}$/;
					if (!ret.test(userName)) {
						$(".addWrongInfo").html("*用户名格式错误！");
						$(".log_btn").css("cursor","not-allowed");
						$(".allState1").html(" ✕").css("color","red");
					} else {
						$(".addWrongInfo").html("");
						$(".allState1").html(" ✓").css("color","#32CD32");
						$(".log_btn").css("cursor","pointer");
					}
					if (userName == "" || userName == null) {
						$(".addWrongInfo").html("*用户名格式错误！用户名不能为空！");
						$(".log_btn").css("cursor","not-allowed");
						$(".allState1").html(" ✕").css("color","red");
					}
				});
				//密码正则判断
				$(".l_pwd").first().blur(function() {
					var userName = $(".l_pwd").first().val();
					var ret = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/;
					if (!ret.test(userName)) {
						$(".addWrongInfo").html("*密码格式错误！6-20位,需包含字母数字");
						$(".allState2").html(" ✕").css("color","red");
						$(".log_btn").css("cursor","not-allowed");
					} else {
						$(".addWrongInfo").html("");
						$(".allState2").html(" ✓").css("color","#32CD32");
						$(".log_btn").css("cursor","pointer");
					}
				});

				//密码正则判断
				$(".l_pwd").last().blur(function() {
					var userNameFirst = $(".l_pwd").first().val();
					var userNameLast = $(".l_pwd").last().val();

					var ret = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/;
					if ( /* !ret.test(userName) && */ userNameLast != userNameFirst) {
						$(".addWrongInfo").html("*密码格式错误！必须和上面密码一致！");
						$(".allState3").html(" ✕").css("color","red");
						$(".log_btn").css("cursor","not-allowed");
					} else {
						$(".addWrongInfo").html("");
						$(".allState3").html(" ✓").css("color","#32CD32");
						$(".log_btn").css("cursor","pointer");
					}

				});
				//邮箱正则验证
				$(".l_email").blur(function() {
					var userName = $(".l_email").val();

					var ret = /^(\w)+(\.\w+)*@(\w)+((\.\w{2,3}){1,3})$/;
					if (!ret.test(userName)) {
						$(".addWrongInfo").html("*邮箱格式不正确，请重新输入！");
						$(".allState4").html(" ✕").css("color","red");
						$(".log_btn").css("cursor","not-allowed");
					} else {
						$(".addWrongInfo").html("");
						$(".allState4").html(" ✓").css("color","#32CD32");
						$(".log_btn").css("cursor","pointer");
					}

				});

				//手机正则验证
				$(".l_tel").blur(function() {
					var userName = $(".l_tel").val();
					var ret = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/;
					if (!ret.test(userName)) {
						$(".addWrongInfo").html("*手机号格式不正确，请重新输入！");
						$(".allState5").html(" ✕").css("color","red");
						$(".log_btn").css("cursor","not-allowed");
						
					} else {
						$(".addWrongInfo").html("");
						$(".allState5").html(" ✓").css("color","#32CD32");
						$(".log_btn").css("cursor","pointer");
					}
  
				});

				
				$(".l_user").blur(function(){
					var userName = $.trim($(this));
					if(userName == ""){
						return;
					}
				});
				/* $(".l_mem").blur(function(){
					var man = document.getElementById("sexMan").value;
					var woman = document.getElementById("sexWoman").value;
					//选中状态
					var checkMan = $(".sexMan").is(":checked");
					var checkWoman = $(".sexWoman").is(":checked");
					if (checkMan == false && checkWoman == false) {
						$(".addWrongInfo").html("*请选择您的性别！");
					}
				}); */
				$(".chooseClause").blur(function(){
					var checkchooseClause = $(".chooseClause").is(":checked");
					if (checkchooseClause == false) {
						$(".addWrongInfo").html("*请阅读并接受《用户协议》！");
						$(".log_btn").css("cursor","not-allowed");
						
					}else{
						$(".addWrongInfo").html("");
						$(".log_btn").css("cursor","pointer");
						
					}
				});
				/* $(".log_btn").click(function(){
					var isCheckBox = document.getElementsByName(".chooseClause").checked;
					if (isCheckBox == undefined) {
						$(".addWrongInfo").html("*请阅读用户协议！");
					}else{
						$(".addWrongInfo").html("");
					}
					alert(isCheckBox);
					
				}); */

				/* function showUserNameAndPwd() {
					//获取input标签的值
					var username = $(".l_user").val();
					var pwd = $(".l_pwd").val();
					$.getJSON(
						"SywUserRegistServlet", {
							"sywUserName": username,
							"sywPassword": pwd
						},
						function(data) {
							$(data.a).each(function() {
							})
						}
					)
				} */

			});
			
			/* function checksVerify(){
				var checkCode = $(".l_user").val();
				$.getJSON(
					"SywUserRegistServlet",
					null,
					function(data){
						if (data == "false") {
							$(".addWrongInfo").html("验证码错误");
							log_btn.disabled="disabled";//错误就禁用登录按钮
						} else{
							$(".addWrongInfo").html("");
							log_btn.disabled="";
						}
					},"text");
			} */
		</script>

		<title>易买网注册</title>
	</head>
	<body>
		<!--Begin Header Begin-->
		<div class="soubg">
			<div class="sou">
				<span class="fr">
					<span class="fl">你好，请<a href="Login.html">登录</a>&nbsp; <a href="Regist.html" style="color:#ff4e00;">免费注册</a>&nbsp;
					</span>
					<span class="fl">|&nbsp;关注我们：</span>
					<span class="s_sh"><a href="#" class="sh1">新浪</a><a href="#" class="sh2">微信</a></span>
					<span class="fr">|&nbsp;<a href="#">手机版&nbsp;<img src="images/s_tel.png" align="absmiddle" /></a></span>
				</span>
			</div>
		</div>
		<!--End Header End-->
		<!--Begin Login Begin-->
		<div class="log_bg">
			<div class="top">
				<div class="logo"><a href="Index.jsp"><img src="images/logo.png" /></a></div>
			</div>
			<div class="regist">
				<div class="log_img"><img src="images/l_img.png" width="611" height="435" /></div>
				<div class="reg_c" style="height: 750px;">
					<form style="margin-top: 100px;" action="SywUserRegistServlet">
						<table border="0" style="width:420px; font-size:14px; margin-top:20px;" cellspacing="0" cellpadding="0">
							<tr height="50" valign="top">
								<td width="95">&nbsp;</td>
								<td>
									<span class="fl" style="font-size:24px;">注册</span>
									<span class="fr">已有商城账号，<a href="Login.jsp" style="color:#ff4e00;">我要登录</a></span>
									<p class="addWrongInfo" style="margin-top:10px; color: red; clear:both"></p>
								</td>
							</tr>
							<tr height="50" style="margin-top: 100px;">
								<td align="right">
									<font color="#ff4e00">*</font>&nbsp;用户名 &nbsp;
								</td>
								<td><input type="text" value="" class="l_user" name="sywUserName" id="inputUserName" /><span class="allState1">&nbsp;</span></td>

							</tr>
							<tr height="50">
								<td align="right">
									<font color="#ff4e00">*</font>&nbsp;密码 &nbsp;
								</td>
								<td><input type="password" value="" class="l_pwd" name="sywPassword" /><span class="allState2">&nbsp;</span></td>

							</tr>
							<tr height="50">
								<td align="right">
									<font color="#ff4e00">*</font>&nbsp;确认密码 &nbsp;
								</td>
								<td><input type="password" value="" class="l_pwd" name="sywPassword" /><span class="allState3">&nbsp;</span></td>

							</tr>
							<tr height="50">
								<td align="right">
									<font color="#ff4e00">*</font>&nbsp;邮箱 &nbsp;
								</td>
								<td><input type="text" value="" class="l_email" name="sywEmail" /><span class="allState4">&nbsp;</span></td>

							</tr>
							<tr height="50">
								<td align="right">
									<font color="#ff4e00">*</font>&nbsp;手机 &nbsp;
								</td>
								<td><input type="text" value="" class="l_tel" name="sywTellPhone" /><span class="allState5">&nbsp;</span></td>

							</tr>
							<tr height="50">
								<td align="right">性别 &nbsp;</td>
								<td><input type="radio" value="男" id="sexMan" class="l_mem" name="sywSex" style="margin: -100px; height: 20px;padding: -100px;" />男</td>
								<td><input type="radio" value="女" id="sexWoman" class="l_mem" name="sywSex" style="margin: -200px; height: 20px;padding: -100px;float: none;" />女</td>
							</tr>
							<!-- <tr height="50">
								<td align="right">邀请人ID号 &nbsp;</td>
								<td><input type="text" value="" class="l_num" /></td>

							</tr> -->
							<tr height="50">
								<td align="right">
									<font color="#ff4e00">*</font>&nbsp;验证码 &nbsp;
								</td>
								<td>
									<input type="text" value="" class="l_ipt" name="sywVerify" id="userInput"/><span class="allState6">&nbsp;</span>
									<input type="button" onclick="document.getElementById('safeCode').src='Code.jsp?s='+Math.random();" value="看不清换一张" />
								</td>

							</tr>
							<tr>
								<td class="field"></td>
								<td>
									<img src="Code.jsp" id="safeCode" />
									<span></span>
								</td>
							</tr>
							<tr>
								<td>&nbsp;</td>
								<td style="font-size:12px; padding-top:20px;">
									<span style="font-family:'宋体';" class="fl">
										<label class="r_rad"><input type="checkbox" class="chooseClause" name="chooseClause" /></label><label class="r_txt">我已阅读并接受《用户协议》</label>
									</span>
								</td>
							</tr>
							<tr height="60">
								<td>&nbsp;</td>
								<td><input type="submit" value="立即注册" class="log_btn" onclick="doVerify()"/></td>
							</tr>
						</table>
					</form>
				</div>
			</div>
		</div>
		<!--End Login End-->
		<!--Begin Footer Begin-->
		<div class="btmbg">
			<div class="btm">
				备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com Copyright © 2015-2018 尤洪商城网 All Rights Reserved. 复制必究 , Technical
				Support: Dgg Group <br />
				<img src="images/b_1.gif" width="98" height="33" /><img src="images/b_2.gif" width="98" height="33" /><img src="images/b_3.gif"
				 width="98" height="33" /><img src="images/b_4.gif" width="98" height="33" /><img src="images/b_5.gif" width="98"
				 height="33" /><img src="images/b_6.gif" width="98" height="33" />
			</div>
		</div>
		<!--End Footer End -->
		<script  type="text/javascript" charset="utf-8">
			//比对验证码是否与随机生成验证码相同
			function doVerify(){
				var userInput=document.getElementById("userInput").value;
				/* alert(userInput); */
				$.getJSON(
					"DoVerifyServlet",
					{"userInput":userInput},
					function(data) {
						if(data==true){
							$(".addWrongInfo").html("");
							$(".allState1").html(" ✓").css("color","#32CD32");
						}else{
							$(".addWrongInfo").html("*验证码不匹配，请检查输入！");
							$(".allState1").html(" ✕").css("color","red");
						}
					}
				)
			}
			//比对数据库用户名是否存在
			$(function(){
				$(".l_user").blur(function(){
					var inputUserName = document.getElementById("inputUserName").value;
					/* alert(inputUserName); */
					$.getJSON(
						"SywSelectUserName",
						{"inputUserName":inputUserName},
						function(data){
							if (data==true) {
								$(".addWrongInfo").html("*用户名已存在，请重新输入！");
								$(".allState1").html(" ✕").css("color","red");
							} else{
								if (inputUserName != null && inputUserName !="") {
									$(".addWrongInfo").html("*用户名可以使用！");
									$(".allState1").html(" ✓").css("color","#32CD32");
								}
							}
						}
					
					)
					
					
					
				});
			});
			
			
		</script>
	</body>


	<!--[if IE 6]>
<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>
